Removes large black objects in a given region of a 1-bit image based on size and density.
The uncompressed image to be processed must reside in the Get Queue prior to REQ_EXEC. Typically, the image will be fully contained in the Get Queue, but that is not a requirement. The output image will be placed into the Put Queue during REQ_EXEC.
- Subcode is set to SF_SUBCODE_REMOVE_BLOBS (15).
- u.PicFlags2 if the FP2_ActOnRectangle flag is true, then only the rectangle given will be examined for data. If false, the entire image will be processed.
- u.RectX is the distance from the left edge, in pixels, of rectangle of interest.
- u.RectY is the distance from the top edge, in pixels, of rectangle of interest.
- u.RectWidth is the width, in pixels, of rectangle of interest.
- u.RectHeight is the height, in pixels, of rectangle of interest.
- u.SC15.MinimumPixelCount is set to the minimum number of pixels an object must contain to be considered for removal.
- u.SC15.MaximumPixelCount is set to the maximum number of pixels an object must contain to be considered for removal.
- u.SC15.MinimumDensity is set to the minimum density, as a percentile in the range [0 - 100], that an object must have to be removed. The density is defined as the number of black pixels in the object divided by the area of the convex hull of the object. Solid convex objects such as circles and squares will have densities approaching 100 (with some variation due to rounding in the hull calculation), while hollow or concave objects like the letters "O" and "C" will have low densities.
- Stride is set to the image line width in bytes including padding at the end of the line width or to 0. If Stride is 0 and PF_NoDibPad is set in PicFlags, the operation will compute the stride using: [ (PixelWidth*BitCount)/8 ]. If Stride is 0 and PF_NoDibPad is not set in PicFlags, the operation will compute the stride using: [ (((PixelWidth*BitCount)+31)&(~31))/8 ].
In addition to the output image, the following output will be stored in the PIC_PARM structure.
- CountOfFeaturesFound is set to the number of matching objects that were removed from the image.
- OutputStride is set, during REQ_INIT and REQ_EXEC, to the image line width in bytes including padding at the end of the line.
- BiOut is set, during REQ_INIT and REQ_EXEC, to the attributes of the output image. Since this operation does not adjust the size of the image, BiOut will be set to a copy of the Head structure within PIC_PARM.
- If the ReportingDatafield is set to point to a ScanFixReportDatainstance, then the defer function will be called with a value of RES_QUERYfor every blob detected in the image. The ScanFixReportData.Subcode will be set to SF_SUBCODE_REMOVE_BLOBS, and ScanFixReportData.u.BlobData will contain information about the currently selected blob. If the blob is to be deleted, then ScanFixReportData.u.BlobData.DeleteBlobshould be set to a non-zero value. If ScanFixReportData.Stopis set to a non-zero value, then the defer function will not be called for any subsequent blobs in the image, and all remaining blobs will be left in the image.